package org.springframework.beans.po;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author szHua
 */
public class MyBean implements Serializable {

    private String username;

    private Integer age;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "MyBean{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MyBean myBean = (MyBean) o;
        return Objects.equals(username, myBean.username) &&
                Objects.equals(age, myBean.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, age);
    }
}
